

// 首页搜索功能
const searchMountains = (keywords) => {
    return http.get(
        'api/mountain/searchMountains',
        {
            params:{ keywords }
        }
    )
}
// 首页 最新公告
const getNewNotice = () => {
    return http.get(
        'api/notice/getNewNotice'
    )
}

// 公共监督页面 一键呼叫信息
const getPhone = (page, limit) => {
    return http.post(
        'api/phone/getPhone',
        {page, limit}
    )
}
//公众监督 提交
const subSuperviseInfo = (data) => {
    return http.post(
        'api/supervise/subSuperviseInfo',
        // {...data}
        {title:data.title, desc: data.desc,username: data.name, phone: data.phone}
    )
}

// 平台信息 右侧导航栏数据
const getArticleTypeList = (page,limit) => {
   return http.post(
        'api/article/getArticleTypeList'
    )
}

// 平台信息 根据右侧导航栏数据获取文章列表
const getArticleList = (id,page,limit) => {
    return http.post(
        'api/article/getArticleList',
        {cate_id: id,page,limit}
    )
}
// 点击文章列表 获取文章详情
const getArticleDetail = (id) => {
    return http.post(
        'api/article/getArticleDetail',
        {article_id:id}
    )
}
// 信息资讯页面 公告
const getNoticeList = () => {
    return http.post(
        'api/notice/getNoticeList'
    )
}

// 信息资讯页面 信息资讯数据
const getIndexList = () => {
    return http.post(
        'api/article/getIndexList'
    )
}

// 平台信息 最热资讯
const getHotArticle = () => {
    return http.post(
        'api/article/getHotArticle'
    )
}

// 山体信息页面数据
const getAllCitys = () => {
    return http.post(
        'api/mountain/getAllCitys'
    )
}
// 根据山体页面 左侧导航 加载山体列表
const getMountains = (id, page,limit) => {
    return http.post(
        'api/mountain/getMountains',
        {area_id: id, page,limit}
    )
}

// 山体详情数据
const mountainDetail = (id) => {
    return http.post(
        'api/mountain/mountainDetail',
        {id}
    )
}

// 互动参与提交
const subInteractiveInfo = (data) => {
    return http.post(
        'api/interactive/subInteractiveInfo',
        // {...data}
        {
            title: data.title,
            desc: data.desc,
            username: data.username,
            phone: data.phone,
            longitude: data.longitude,
            latitude: data.latitude,
            mountain_id: data.mountain_id,
            img: data.img
        }
    )
}
// 事件上报接口
const setInspection = (data) => {
    return http.post(
        'api/inspection/setInspection',
        {
            inspection_des: data.inspection_des,
            nickname: data.nickname,
            mobile: data.mobile,
            mountain_id: data.mountain_id,
            happen_time: data.happen_time,
            longitude: data.longitude,
            latitude: data.latitude,
            inspection_img: data.inspection_img
        }
    )
}

// 首页互动参与展示
const getAllList = () => {
    return http.post(
        'api/interActive/getAllList'
    )
}

// 首页的山体信息
const mountainIndex = () => {
    return http.post(
        'api/mountain/mountainIndex'
    )
}
// 首页山脉风景
const getMountainScenery = () => {
    return http.post(
        'api/mountain/getMountainScenery'
    )
}

// 图片上传接口
const uploader = (files) => {
    return axios({
        method:'post',
        url:'http://image.sdxing.cn/image/uploadByBase64',
        data:{
            file: files.file,
            name: files.name
        }
    })
}

// 首页风景图
const getSlideshow = () => {
    return http.post(
        'api/inspection/getSlideshow'
    )
}
// 首页轮播图
const getScenery = () => {
    return http.post(
        'api/inspection/getScenery'
    )
}

// 获取所有山体坐标
const getAllLocation = (area,street_id) => {
    return http.post(
        'api/mountain/getAllLocation',
        {area,street_id}
    )
}

// 根据区域获取所有街道
const getStreetsByArea = (id) => {
    return http.post(
        'api/mountain/getStreetsByArea',
        {area_id: id}
    )
}

// 根据山体获取
const getMountainByStreet = (id) => {
    return http.post(
        'api/mountain/getMountainByStreet',
        {street_id: id}
    )
}
// 获取山体详情 管理目标数据
const getMountainText = () => {
    return http.get(
        'api/mountain/getMountainText'
    )
}
